package com.ehotting.edsta.system.api;

import com.ehotting.eaf.core.constant.SecurityConstants;
import com.ehotting.eaf.core.constant.ServiceNameConstants;
import com.ehotting.eaf.core.domain.R;
import com.ehotting.eaf.core.domain.system.api.AppVersion;
import com.ehotting.edsta.system.api.factory.RemoteVersionFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "remoteVersionService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteVersionFallbackFactory.class)
public interface RemoteVersionService {

    /**
     * 通过最新的版本信息
     *
     * @param platform 系统平台
     * @param source 请求来源
     * @return 结果
     */
    @GetMapping("/version/getLatestInfo")
    R<AppVersion> getLatestInfo(@RequestParam("platform") String platform, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
